<?php 
session_start();
if (!isset($_SESSION['username'])) {
	exit("密码修改错误。");
}

$newpass = isset($_GET['newpass'])? $_GET['newpass']:"";

if($newpass=="") exit("密码修改错误。");

$newpass = MD5($newpass);

$myfile = fopen("config.inc.php", "w") or die("文件写入错误，密码修改错误。");
fwrite($myfile,"<?php\n\t\$username = 'admin';\n\t\$hash_password = '$newpass';\n?>");
echo "密码修改成功。";
?>